package com.ruoyi.common.order.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.order.service.OrderNumberService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/orderNumber")
public class OrderNumberController extends BaseController {


    private OrderNumberService orderNumberService;

    public OrderNumberController(OrderNumberService orderNumberService) {
        this.orderNumberService = orderNumberService;
    }

    @GetMapping("/reBuildOrderNumber")
    public AjaxResult reBuildOrderNumber(String date, String code) {

        if ((null == date || date.isEmpty()) || (null == code || code.isEmpty())) {
            throw new RuntimeException("参数异常!");
        }
        return AjaxResult.success("操作成功!",orderNumberService.reBuildOrderNumber(date,code));
    }


}

